﻿{ZL.Source id="常规商品数据源"/}<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>{SField sid="常规商品数据源" FD="Proname" page="0"/}_{$SiteName/}</title>
<meta name="Keywords" content="{SField sid="常规商品数据源" FD="Meta_Keywords" page="0"/}" />
<meta name="description" content="{SField sid="常规商品数据源" FD="Meta_Description" page="0"/}" />
{ZL:Boot()/}
<link href="/dist/css/weui.min.css" rel="stylesheet" />
<link href="{$CssDir/}global.css?Version={ZL.Label id="前端样式版本号"/}" rel="stylesheet"/>
<script type="text/javascript" src="{$CssDir/}js/jquery.imagezoom.min.js"></script>
<script src="/js/scrolltopcontrol.js" type="text/javascript"></script>
<script type="text/javascript" src="{$CssDir/}js/server.js"></script>
<script src="/JS/Controls/B_User.js"></script>
<style type="text/css">
::after, ::before { box-sizing:content-box;}
.shop_top { position:relative;}
#form .weui-cell__bd p { margin-bottom:0;}
</style>
</head>
<body>
<div class="shop_top">
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand home_logo" href="/"><img src="{$LogoUrl/}" alt="{$SiteName/}"/></a>
<h1 class="home_top_i"><a href="{ZL:GetNodeLinkUrl(2)/}">在线商城</a></h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="/">首页</a></li>
<li><a href="{ZL:GetNodeLinkUrl(1)/}">门户</a></li>
<li><a href="{ZL:GetNodeLinkUrl(2)/}">商城</a></li>
<li><a href="/office">办公</a></li>
<li><a href="/Index">社区</a></li>
<li class="dropdown dropdown_a">
<a href="javascript:;"><i class="fa fa-th"></i></a>
<ul class="dropdown-menu" role="menu">
<div class="arrow"></div>
<li><a href="{ZL:GetNodeLinkUrl(1)/}" title="资讯中心" target="_blank">资讯中心</a></li>
<li><a href="{ZL:GetNodeLinkUrl(84)/}" title="资源下载" target="_blank">资源下载</a></li>
<li><a href="{ZL:GetNodeLinkUrl(85)/}" title="图库中心" target="_blank">图库中心</a></li>
<li><a href="{ZL:GetNodeLinkUrl(99)/}" title="分类信息" target="_blank">分类信息</a></li>
<li><a href="{ZL:GetNodeLinkUrl(86)/}" title="在线视频" target="_blank">在线视频</a></li>
<li><a href="{ZL:GetNodeLinkUrl(3)/}" title="网店频道" target="_blank">网店频道</a></li>
<li><a href="{ZL:GetNodeLinkUrl(2)/}" title="在线商城" target="_blank">在线商城</a></li>
</ul>
</li>
<li>
<a onClick="iSearch()"><i class="fa fa-search"></i></a>
<div class="home_search">
<form role="search" method="get" action="/Search/SearchList" target="_blank">
<div class="input-group">
<input type="text" class="form-control" name="keyword" placeholder="全站检索">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">搜索</button>
</span>
</div>
</form>
</div>
</li>
<li>
<a class="Channel" href="javascript:StranBody()" name="StranLink" id="StranLink" title="點擊以繁體中文方式瀏覽">繁體</a>
<script language="javascript" src="/js/gb_big5.js"></script>
</li>
<li class="dropdown nav_user"><a href="javascript:;">登录</a>
<ul class="dropdown-menu" role="menu">
<li><a href="/User/Login?ReturnUrl={ZL:GetShopUrl({SField sid="常规商品数据源" FD="ID" page="0"/})/}">用户登录</a></li>
<li><a href="/User/Register" target="_blank">用户注册</a></li>
<li><a href="/User/Info/UserInfo" target="_blank">注册信息</a></li>
<li><a href="javascript:;" onClick="LogoutFun();">安全退出</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div>
<div class="shopcon_banner">
<div class="container">
<h3> <a href="{ZL:GetNodeLinkUrl({SField sid="常规商品数据源" FD="NodeID" page="0"/})/}"><i class="fa fa-mail-reply"></i> {ZL.Label id="输出指定ID节点名" NodeID="{SField sid="常规商品数据源" FD="NodeID" page="0"/}" /} </a></h3>
</div>
</div>
<div class="container margintop10">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
<div class="list-group">
<a href="{ZL:GetNodeLinkUrl(75)/}" class="list-group-item active"><span class="badge">更多</span>服装鞋帽</a>
<a href="{ZL:GetNodeLinkUrl(75)/}" class="list-group-item">服装鞋帽</a>
<a href="{ZL:GetNodeLinkUrl(133)/}" class="list-group-item">营养美食</a>
<a href="{ZL:GetNodeLinkUrl(132)/}" class="list-group-item">珠宝首饰</a>
<a href="{ZL:GetNodeLinkUrl(131)/}" class="list-group-item">体育用品</a>
<a href="{ZL:GetNodeLinkUrl(130)/}" class="list-group-item">手机数码</a>
<a href="{ZL:GetNodeLinkUrl(129)/}" class="list-group-item">日常用品</a>
</div>
<div id="botM_dh" >
<div class="botM_er"> 
<a href="/manage/Panoramic/PanoramicShow.aspx?id=1" class="btn btn-default" target="_blank">三维全景</a>
<a href="/try/" class="btn btn-primary" target="_blank">在线试戴</a>
<a href="/D3/" class="btn btn-success" target="_blank">3D商街</a>
<a href="/Questions/Default.aspx?id=1" class="btn btn-info" target="_blank">智能组卷</a>
<a href="/guest/" class="btn btn-warning" target="_blank">在线留言</a>
<a href="/user/UserZone/Default" class="btn btn-info" target="_blank">SNS社区</a>
<a href="/Edit" class="btn btn-success" target="_blank">在线助写</a>
<a href="/Prompt/correct.aspx" class="btn btn-primary" target="_blank">在线纠错</a>
<a href="/Prompt/EmailSender.aspx" class="btn btn-danger" target="_blank">邮件订阅</a>
</div>
</div>
</div>
<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
<div class="box">
<div class="tb-booth tb-pic tb-s310">
<a href='{ZL:GetPicUrl({SField sid="常规商品数据源" FD="Thumbnails" page="0"/})/}'><img src='{ZL:GetPicUrl({SField sid="常规商品数据源" FD="Thumbnails" page="0"/})/}' alt='{SField sid="常规商品数据源" FD="Proname" page="0"/}' rel='{ZL:GetPicUrl({SField sid="常规商品数据源" FD="Thumbnails" page="0"/})/}' class="jqzoom" alt="{SField sid="常规商品数据源" FD="Proname" page="0"/}" /></a>
</div>
<div class="row">
<ul class="tb-thumb list-unstyled" id="thumblist">
<li class="col-lg-2 col-md-2 col-sm-2 col-xs-2 tb-selected">
<div class="tb-pic tb-s40">
<a href="javascript:;">
<img src="{ZL:GetPicUrl({SField sid="常规商品数据源" FD="Thumbnails" page="0"/})/}" mid="{ZL:GetPicUrl({SField sid="常规商品数据源" FD="Thumbnails" page="0"/})/}" big="{ZL:GetPicUrl({SField sid="常规商品数据源" FD="Thumbnails" page="0"/})/}" alt="{SField sid="常规商品数据源" FD="Proname" page="0"/}">
</a>
</div>
</li>
<script>
var pics='{SField sid="常规商品数据源" FD="picture" page="0"/}';
var jsonstr=JSON.parse(pics);
if(jsonstr.length>0)
{
	for(i=0;i<jsonstr.length;i++)
	{
		document.write('<li class="col-lg-2 col-md-2 col-sm-2 col-xs-2"><div class="tb-pic tb-s40"><a href="javascript:;"><img src="/UploadFiles/'+jsonstr[i].url+'" mid="/UploadFiles/'+jsonstr[i].url+'" big="/UploadFiles/'+jsonstr[i].url+'" alt="'+jsonstr[i].desc+'"></a></div></li>');
	}
}
</script>
</ul>
</div>
</div>


</div>
<div  class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
<h2>{SField sid="常规商品数据源" FD="Proname" page="0"/}</h2>
<form id="form" name="form" method="post" action="/Cart/Cart.aspx" style="margin-bottom:10px;">
<input name="id" type="hidden" id="id" value="{SField sid="常规商品数据源" FD="ID" page="0"/}" />
<div class="weui-cells">
<div class="weui-cell">
<div class="weui-cell__bd"><p>编号</p></div>
<div class="weui-cell__ft">{SField sid="常规商品数据源" FD="ProCode" page="0"/}</div>
</div>
<div class="weui-cell">
<div class="weui-cell__bd"><p>品牌</p></div>
<div class="weui-cell__ft">{SField sid="常规商品数据源" FD="brand" page="0"/}</div>
</div>
<div class="weui-cell">
<div class="weui-cell__bd"><p>库存</p></div>
<div class="weui-cell__ft">{SField sid="常规商品数据源" FD="stock" page="0"/}</div>
</div>
<div class="weui-cell">
<div class="weui-cell__bd"><p>市场价</p></div>
<div class="weui-cell__ft">{ZL:GetMoney({SField sid="常规商品数据源" FD="ShiPrice" page="0"/},2,1)/} 元</div>
</div>
<div class="weui-cell">
<div class="weui-cell__bd"><p>零售价</p></div>
<div class="weui-cell__ft"><span style="font-size:1.5em; font-weight:bold; color:#f40;"><i class="fa fa-rmb"></i> {ZL:GetMoney({SField sid="常规商品数据源" FD="LinPrice" page="0"/},2,1)/}元</span></div>
</div>

<div class="weui-cell">
<div class="weui-cell__bd"><p>购买数量</p></div>
<div class="weui-cell__ft">
<div class="input-group input-group-sm" style="max-width:150px;">
<span class="input-group-btn"><button class="btn btn-info" type="button" onClick="LessNum();"><i class="fa fa-minus"></i></button></span>
<input type="text" class="form-control text-center" name="Pronum" id="Pronum" value="1" />
<span class="input-group-btn"><button class="btn btn-info" type="button" onClick="AddNum();"><i class="fa fa-plus"></i></button></span>
</div>
</div>
</div>
</div>
<input name="Attribute" id="Attribute"  type="hidden" value="">
<input name="color" value="" id="color" type="hidden" />
<input name="size" value="" id="size" type="hidden" />
</form>
<button type="button" onClick="subm()" class="btn btn-danger"><i class="fa fa-shopping-cart"></i> 立即购买</button>
<button type="button" onClick="AddCart()" class="btn btn-danger"><i class="fa fa-plus-square"></i> 加入购物车</button>
<a onclick="addfav()" href="javascript:;" class="btn btn-link"><i class="fa fa-heart"></i> 关注商品</a>
</div>
</div>
<!--内容主体开始 -->
<ul class="nav nav-tabs" style="margin-top:1em;">
<li class="active"><a href="#home" data-toggle="tab">商品详细</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home">{SField sid="常规商品数据源" FD="Procontent" page="0"/} </div>
</div>
<script>
var strval='{SField sid="常规商品数据源" FD="Nums" page="0"/}';
strval=strval.split(','); 
for(var i=0;i<strval.length;i++){
strval[i]=strval[i].split('|');
if(strval[i].length>1){
document.getElementById("priceC").innerHTML+=strval[i][0]+"|价格:<input type='hidden' name='price' id='price"+i+"' value='"+strval[i][1]+"'>"+strval[i][1]+"<input type='text' name='num' id='num"+i+"' value='1' >件<input type='button' class='gopay' id='buttons"+i+"' onclick='putval("+i+")' value='购买'><br>";
}; 
}
function putval(num){
document.getElementById("Stock").value=document.getElementById("num"+num).value;//赋予购物表单中商品数量值
document.getElementById("Wholesaleone").value=document.getElementById("price"+num).value;//赋予购物表单中商品价格值
formw.submit();//提交name为formw的form表单
}
</script> 
<!--右 --> 
<div class="iframe_comm" id="iframe_comm" hidden>
<iframe id="comm_ifr" scrolling="no" onload="IfrAutoHeight();" src='/User/Order/ShareList?ProID={SField sid="常规商品数据源" FD="ID" page="0"/}' style="width:100%;" align="middle" frameborder="0"></iframe>
<script type="text/javascript" src="/JS/Modal/APIResult.js"></script>
<script>
	function commentAnchor() { $("html,body").animate({ scrollTop: $("#iframe_comm").offset().top - 100 }, 300); }
	function IfrAutoHeight() { var $ifr = $("#comm_ifr"); $ifr.height($ifr.contents().height()); }
	function addfav() {
	    $.post("/API/mod/collect.ashx", {action:"add",favurl:"/Shop.aspx?itemid={SField sid="常规商品数据源" FD="ID" page="0"/}",infoid:"{SField sid="常规商品数据源" FD="ID" page="0"/}",type:2,title:"{SField sid="常规商品数据源" FD="Title" page="0"/}"},function(data){
	    var model=JSON.parse(data);
	    if(APIResult.isok(model)){
	        alert("收藏成功!");
	    }else{
	        alert("收藏失败!原因:"+model.retmsg);
	    }
	});
	}
</script>
</div>

</div>
</div>
</div>
<!--套餐-->
<div class="container">
<div role="tabpanel" class="pro_group">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#t1" aria-controls="t1" role="tab" data-toggle="tab"></a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="t1">
<div class="pro_tui_ms"></div>
</div>
</div>
</div>
</div>

<div class="shop_ad">
<div class="shop_ad_t">
<div class="media">
<div class="media-body media-middle">
<h4 class="media-heading">动力逐浪</h4>
<p>在线云建站  微信3分极速场景</p>
<p>微调查微相册全搞定   不用代码也能做开发</p>
<p>http://v.z01.com</p>
<a href="http://v.z01.com" target="_blank">免费体验</a>
</div>
<div class="media-right media-middle">
<a href="#">
<img class="media-object" src="{$CssDir/}images/Big_Micro.jpg" alt="{$SiteName/}"/>
</a>
</div>
</div>
</div>
</div>
<!--内容主体结束 -->
{ZL.Label id="响应式全站底部"/}
</body>
</html>
<script>
/*动态输出商品组合详细信息*/
var para = {
key:'',
alias:'product',
psize:'1000',
cpage:1,
cate:1,
proid:'"id":"{SField sid="常规商品数据源" FD="ID" page="0"/}"'
}
$.post("/API/Center.ashx?action=GetCustom",para,function(data){
	data=JSON.parse(data);
	if(data.result!="[]"){
		data=JSON.parse(data.result);
		for(var i=0;i<data.length;i++){
			var prohtml='';
			proStr=data[i].procontent;
			proID=data[i].id;
			proPrice=data[i].shiprice;
			proName=data[i].proname;
			proStr=JSON.parse(proStr);
			$.each(proStr,function(i,proStr){
				prohtml+='<div class="pro_tui_m" data-id='+proStr.id+'><a href="/Shop/'+proStr.id+'.aspx"><img src="/UploadFiles/nopic.gif" alt="'+proStr.name+'" value="'+proStr.name+'" /></a><h4><a href="/Shop/'+proStr.id+'.aspx">'+proStr.name+'</a></h4><p>单价：<span>'+proPrice.toFixed(2)+'</span></p><i class="fa fa-plus"></i></div>';
			});
			$(".pro_group .nav-tabs li:nth-child("+(i+1)+") a").html(proName);
			if(i>=1){
				var str='<li role="presentation"><a href="#t'+(i+1)+'" aria-controls="t'+(i+1)+'" role="tab" data-toggle="tab">'+proName+'</a></li>';
				var str1='<div role="tabpanel" class="tab-pane" id="t'+(i+1)+'"><div class="pro_tui_ms"></div></div>'
				$(".pro_group ul").append(str);
				$(".pro_group .tab-content").append(str1);
			}
			var a1='<div class="pro_tui_je"><i>=</i><p>组合价:<span>'+proPrice.toFixed(2)+'</span><a href="/Cart/Cart.aspx?ID='+proID+'&Pronum=1">立即购买</a></p></div>';
			$(".pro_group .tab-content .tab-pane:nth-child("+(i+1)+") .pro_tui_ms").append('<div class="pro_tui_k">'+prohtml+'<div class="clearfix"></div></div>');
			$(".pro_group .tab-content .tab-pane:nth-child("+(i+1)+")").append(a1+'<div class="clearfix"></div>');
		}
        /*设置每个商品的缩略图*/
		$(".pro_tui_m").each(function(index, element) {
			var id=$(this).data(id);
			var para = {
			key:'',
			alias:'propic',
			psize:'1000',
			cpage:1,
			cate:1,
			proid:id.id
			}
			$.post("/API/Center.ashx?action=GetCustom",para,function(data){
				proPic='';
				data=JSON.parse(data);
				if(data.result!=""){
					data=JSON.parse(data.result);
                    if(data[0].thumbnails!=null){
                        if(data[0].thumbnails.indexOf("UploadFile")) proPic="/UploadFile/"+data[0].thumbnails;
					    else proPic="/"+data[0].thumbnails;
                    }else{
                        proPic="/UploadFiles/nopic.gif";
                    }
					$(".pro_tui_m[data-id='"+id.id+"']").find("img").attr("src",proPic);
					$(".pro_group .pro_tui_m[data-id='"+id.id+"'] p span").html(data[0].shiprice.toFixed(2));
				}
			});
		});
	}else if(data.result=="[]"){
        $(".pro_group").hide();   
    }
    //读取商品个数及设置外层div长度，用于overflow
    $(".pro_group .tab-content .tab-pane .pro_tui_ms .pro_tui_k").each(function(index, element) {
        var h = ($(this).children(".pro_tui_m").length)*13+"em";
        $(this).css("width",h);
    });
});

//会员ajax登录状态需要结合JS/Controls/B_User.js引用同步生效
var buser = new B_User();
buser.IsLogged(function(data,flag){
	if(flag)
	{
		data=JSON.parse(data);
		$(".nav_user>a").html(data.UserName);
		$(".nav_user .dropdown-menu li:nth-child(1) a").html("会员中心");
		$(".nav_user .dropdown-menu li:nth-child(2)").remove();
        $("#iframe_comm").show();
	}
});
function LogoutFun()
{
	buser.Logout(function(){location=location;});
};
$(".shop_top .navbar-nav>li.dropdown").mouseover(function(){
	$(this).addClass("open");
}).mouseout(function(){
	$(this).removeClass("open");
});
/*显示搜索框*/
function iSearch(){
	if($(".home_search").is(":hidden")){
		$(".home_search").fadeIn(250);
	}else{
		$(".home_search").fadeOut(250);
	}
};

//商品图片切换 
$(document).ready(function(){
	$(".jqzoom").imagezoom();
	$("#thumblist li a").click(function(){
		$(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
		$(".jqzoom").attr('src',$(this).find("img").attr("mid"));
		$(".jqzoom").attr('rel',$(this).find("img").attr("big"));
	});
	$(".tese_l>ul>li").click(function(){
		$(this).find("ul").slideToggle();
	})
});

function changUrl(n,a){
    for (var i=0;i<20;i++){
        if(i==a&&document.getElementById("size"+i).className=='normal'){
            document.getElementById("size"+i).className='active';
            $("#size").val(n);
            $("#sizes").html(n);
        }
        else if(i==a&&document.getElementById("size"+i).className=='active'){
            document.getElementById("size"+i).className='normal';
            $("#size").val("");
            $("#sizes").html("");
        }
        else{
            document.getElementById("size"+i).className='normal';
            $("#size").val(n);
            $("#sizes").html(n);
        }
    }
};
function changcolor(n,b) {
    for (var i=0;i<20;i++){
        if(i==b&&document.getElementById("color"+i).className=='normal'){
            document.getElementById("color"+i).className='active';
            $("#color").val(n);
            $("#colors").html(n);
        } 
        else if(i==b&&document.getElementById("color"+i).className=='active'){
            document.getElementById("color"+i).className='normal';
            $("#color").val("");
            $("#colors").html("");
        }
        else{
            document.getElementById("color"+i).className='normal';
            $("#color").val(n);
            $("#colors").html(n);
        }
    }
};
function subm() {
        switch ('{SField sid="常规商品数据源" FD="ProClass" page="0"/}') {
            case "7":
            case "8":
            BeginSubmit();
                break;
            default:
            document.getElementById("Attribute").value = "color:" + document.getElementById("color").value + ",size:" + document.getElementById("size").value;
            document.forms[1].submit();
            break;
    }
};
function BeginSubmit() {
    var d = new Date();
    var time = d.getFullYear() + "/" + d.getMonth()+ "/" + (d.getDate() + 1);
    var arr = [];
    arr.push({ ProID: '{SField sid="常规商品数据源" FD="ID" page="0"/}', GoDate: time, Pronum: $('#Pronum').val(), Remind: "" });
    location = "/Cart/Form/Passengers.aspx?pros=" + JSON.stringify(arr);
}
//数量加减
var pnum=1;
var downcar=parseInt('{SField sid="常规商品数据源" FD="DownCar" page="0"/}');
function AddNum(){
	pnum++;
	var num=pnum*downcar;
	var allnum='{SField sid="常规商品数据源" FD="stock" page="0"/}';
	if(num<=allnum){
		$("#Pronum").val(num);
    }
	else{
		pnum--;
		num=pnum*downcar;
		$("#Pronum").val(num);
	}
}
function LessNum(){
	pnum--;
	var num=pnum*downcar;
	if(num>downcar){
		$("#Pronum").val(num);
	}
	else{
		pnum=1;
		num=pnum*downcar;
		$("#Pronum").val(num);
	}
}
//调用
$( function() {
    $('.i_box').iVaryVal({Fun:function(){}});
});
/*加入购物车*/
function AddCart()
{
    if($("#Pronum").val()>0){
        $.post("/Cart/Cart.aspx?ID="+$("#id").val()+"&Pronum="+$("#Pronum").val());
        alert("加入购物车成功！")
    }
    else alert("商品数量不正确！");
};
</script>